<!DOCTYPE html>
<html>

<head>
    <style>
        .card {
            border: 1px solid red;
            width: 30px;
            height: 30px;
        }

        .box1 {
            display: flex;
            flex-direction: row-reverse;
            flex-wrap: wrap-reverse;
            margin-top: 10px;
            width: 100px;
            border: 1px solid blue;
            /* flex-direction: row | row-reverse | column | column-reverse; 
            flex-flow flex-flow属性是flex-direction属性和flex-wrap属性的简写形式，默认值为row nowrap。
            justify-content flex-start | flex-end | center | space-between | space-around;
            align-items: flex-start | flex-end | center | baseline | stretch;
            align-content: flex-start | flex-end | center | space-between | space-around | stretch;
            order属性
             flex-grow属性定义项目的放大比例，默认为0，即如果存在剩余空间，也不放大。
             flex-shrink属性定义了项目的缩小比例，默认为1，即如果空间不足，该项目将缩小。
             flex-basis属性定义了在分配多余空间之前，项目占据的主轴空间（main size）。浏览器根据这个属性，计算主轴是否有多余空间。它的默认值为auto，即项目的本来大小。
             align-self属性允许单个项目有与其他项目不一样的对齐方式，可覆盖align-items属性。默认值为auto，表示继承父元素的align-items属性，如果没有父元素，则等同于stretch
            */
        }

        .box {
            display: flex;
            flex-direction: row;
            margin-top: 10px;
            width: 100px;
            border: 1px solid blue;
        }

        .card2 {
            border: 1px solid red;
            width: 30px;
            height: 30px;
            flex-grow: 1
        }

        .card3 {
            border: 1px solid red;
            width: 30px;
            height: 30px;
            flex-shrink: 0
        }

        .card4 {
            border: 1px solid red;
            width: 45px;
            height: 45px;
            flex-shrink: 1
        }
        .card5 {
            border: 1px solid red;
            height: 100px;
            width: 100px;
            word-break: keep-all;
        }
        .card6 {
            border: 1px solid red;
            width: 100px;
            height: 100px;
            flex-basis: 100px;
            /* word-break: keep-all; */
        }
        .box-self{
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            width: 300px;
            height: 200px;
            border: 1px solid blue;
           
        }
        .self{
            border: 1px solid red;
            width: 30px;
            height: 30px;
            align-self: flex-end;  
        }
    </style>
</head>

<body>
    <!-- 单位fr是分数的缩写，有几列就定义几个。这么写看上去有点傻，可以用repeat，改起来更方便。 -->
    <div class="box1">
        <div class="card">1</div>
        <div class="card">2</div>
        <div class="card">3</div>
        <div class="card">4</div>
        <div class="card">5</div>
        <div class="card">6</div>
        <div class="card">7</div>
        <div class="card">8</div>
        <div class="card">9</div>
        <div class="card">10</div>
        <div class="card">11</div>
        <div class="card">12</div>
        <div class="card">13</div>
        <div class="card">14</div>
    </div>
    <div class="box">
        <div class="card">1</div>
        <div class="card">2</div>
        <div class="card2">3</div>
    </div>
    <div class="box">
        <div class="card3">1</div>
        <div class="card4">2</div>
        <div class="card4">3</div>
    </div>
    <div>-------------------------------------------------------------</div>
    <div style="display: flex;">
        <div class="card6">一二三四五六七八九十</div>
        <div class="card6">一二三四五六七八九十</div>
        <div class="card6">一二三四五六七八九十</div>
        <div class="card6">一二三四五六七八九十</div>
        <div class="card6">一二三四五六七八九十</div>
        <div class="card5">一二三四五六七八九十</div>
    </div>
    <div class="box-self">
        <div class="card">1</div>
        <div class="card">2</div>
        <div class="card">3</div>
        <div class="card">4</div>
        <div class="card">5</div>
        <div class="card">6</div>
        <div class="self">1</div>

    </div>
</body>

</html>